// ++++++++++++++++++++++++++++++++++++++++
// 《零基础Go语言算法实战》源码
// ++++++++++++++++++++++++++++++++++++++++
// Author:廖显东（ShirDon）
// Blog:https://www.shirdon.com/
// Gitee:https://gitee.com/shirdonl/goAlgorithms.git
// Buy link :https://item.jd.com/14101229.html
// ++++++++++++++++++++++++++++++++++++++++

package main

import "fmt"

func insertionSortDesc(array []int) {
	length := len(array)
	for i := 1; i < length; i++ {
		for j := 0; j < i; j++ {
			if array[j] < array[i] {
				array[j], array[i] = array[i], array[j]
			}
		}
	}
}

func main() {
	array := []int{99, 66, 57, 89, 36, 69, 98}
	insertionSortDesc(array)
	fmt.Println(array)
}

//$ go run interview6-3.go
//[99 98 89 69 66 57 36]
